<template>
  <div class="app-container">
    <Menu 
      :activeMenu="currentMenu" 
      @menu-selected="handleMenuSelection"
    />
    <main class="main-content">
      <UserManagement v-if="currentMenu === 'user'" />
      <OrderManagement v-if="currentMenu === 'order'" />
      <SimulatorRoom v-if="currentMenu === 'simulator'" />
      <MySimulatorRoom v-if="currentMenu === 'claude-simulator'" />
      <div v-if="!currentMenu" class="default-content">
        <h2>欢迎使用管理系统</h2>
        <p>请从左侧菜单选择功能模块</p>
      </div>
    </main>
  </div>
</template>

<script>
import Menu from './components/Menu.vue'
import UserManagement from './components/UserManagement.vue'
import OrderManagement from './components/OrderManagement.vue'
import SimulatorRoom from './components/SimulatorRoom.vue'
import MySimulatorRoom from './components/MySimulatorRoom.vue'

export default {
  name: 'App',
  components: {
    Menu,
    UserManagement,
    OrderManagement,
    SimulatorRoom,
    MySimulatorRoom
  },
  data() {
    return {
      currentMenu: 'user' // 默认进入用户管理
    }
  },
  methods: {
    handleMenuSelection(menuType) {
      this.currentMenu = menuType;
    }
  }
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.default-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #ecf0f1;
  color: #2c3e50;
}

.default-content h2 {
  margin-bottom: 20px;
  font-size: 32px;
}

.default-content p {
  font-size: 18px;
  color: #7f8c8d;
}
</style>
